#!/bin/sh

cd ${HASTHI_HOME:?'Please Set Hasthi Home'}
for i in $HASTHI_HOME/lib/*.jar
do
  CLASSPATH=$CLASSPATH:$i
done

CLASSPATH=$HASTHI_HOME/classes:$CLASSPATH

ROOT_DIR=$HASTHI_HOME/../../..
HASTHI_ADDON_HOME=$ROOT_DIR/management-addon/build/

if [ -e $HASTHI_ADDON_HOME ];then
	for i in $HASTHI_ADDON_HOME/lib/*.jar
	do
		 CLASSPATH=$CLASSPATH:$i
	done
	CLASSPATH=$CLASSPATH:$HASTHI_ADDON_HOME/lib/hyperic-sigar-1.5.0.1/sigar-bin/lib/sigar.jar
	$JAVA_HOME/bin/java -Xmx256m -classpath  $CLASSPATH  hasthi.lead.SigarBasedHostAgent $*  
else
	$JAVA_HOME/bin/java -Xmx256m -classpath  $CLASSPATH  hasthi.instrument.HostAgent $*  
fi
